package com.atguigu.gmall.cart.service;

import com.atguigu.gmall.model.cart.CartInfo;
import com.atguigu.gmall.model.product.SkuInfo;
import com.fasterxml.jackson.core.JsonProcessingException;

import java.util.List;

/**
 * @author 钟涛
 * @version 1.0
 * @description: TODO
 * @date 2021/12/22 14:19
 */
public interface CartService {

    String determinCartKey(String userId, String userTempId);

    SkuInfo addSkuToCart(Long skuId, Integer skuNum, String cartKey) throws JsonProcessingException;

    List<CartInfo> getCartList(String cartKet);

    void updateSkuNum(String cartKey, Long skuId, Integer num) throws JsonProcessingException;

    CartInfo getCartInfo(String cartKey,Long skuId) throws JsonProcessingException;

    void saveCartInfo(String cartKey,CartInfo cartInfo) throws JsonProcessingException;

    void updateSkuStatus(String cartKey, Long skuId, Integer status) throws JsonProcessingException;

    void deleteCartInfo(String cartKey, Long skuId);

    void mergeCart(String userId, String userTempId) throws JsonProcessingException;

    void checkCartSize(String cartKey);

    void checkAllSize(String userId,String userTempId);
}
